package com.zzyl.service.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.zzyl.base.PageResponse;
import com.zzyl.entity.NursingLevel;
import com.zzyl.entity.NursingProject;
import com.zzyl.mapper.NursingLevelMapper;
import com.zzyl.service.NursingLevelService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class NursingLevelServiceImpl implements NursingLevelService {

    @Resource
    private NursingLevelMapper nursingLevelMapper;
    @Override
    public List<NursingLevel> listAll() {
        return nursingLevelMapper.listAll();
    }

    @Override
    public PageResponse<NursingLevel> listByPage(String name, Integer status, Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        Page<NursingLevel> nursingLevels = nursingLevelMapper.listByPage(name, status);
        return PageResponse.of(nursingLevels, NursingLevel.class);
    }
}
